Compressor components call completion functions when they have finished an asynchronous operation. The component supplies a result code to your completion function. This result code indicates the success or failure of the asynchronous operation. Note that any other result data that may be produced by the asynchronous operation is not valid until the component calls your completion function.
The CompletionProcPtr data type defines a pointer to a completion function. You assign a completion function to an image or a sequence by passing a pointer to a structure that identifies the function to the appropriate function.
typedef struct CompletionProcRecord CompletionProcRecord;
The completion function structure contains the following fields:
typedef ICMCompletionProcRecord *ICMCompletionProcRecordPtr;
struct ICMCompletionProcRecord
{
ICMCompletionUPP completionProc;
/* pointer to completion function */
long completionRefCon;
/* reference constant */
};
Your completion function should have the following form:
pascal OSErr MyCompletionProc (OSErr result, short flag,
long refcon);